from aiogram_dialog import Dialog, Window
from aiogram_dialog.widgets.kbd import Button, Cancel, Start

from src.presentation.tg_bot.dialogs.client.orders.orders_history.handlers import show_user_orders
from src.presentation.tg_bot.dialogs.getters.users import user_info_getter
from src.presentation.tg_bot.dialogs.widgets import LocaleText
from src.presentation.tg_bot.states import PaymentSG, UserPaymentsSG, UserProfileSG

user_profile_window = Window(
    LocaleText("your-account"),
    LocaleText("your-balance", balance="{user_balance}$"),
    LocaleText("your-email", email="{user_email}"),
    LocaleText("your-orders-count", orders_count="{orders_count}"),
    LocaleText("registered_date", reg_date="{reg_date}"),
    Start(
        LocaleText("add-balance-btn"),
        id="payment",
        state=PaymentSG.select_amount,
    ),
    Button(LocaleText("orders-btn"), id="proxy", on_click=show_user_orders),
    Button(LocaleText("my-vpns"), id="vpn", on_click=show_user_orders),
    Button(LocaleText("my-vpns-routers"), id="vpn_router", on_click=show_user_orders),
    Start(LocaleText("payments-btn"), id="user_payments", state=UserPaymentsSG.payments_history),
    Cancel(LocaleText("back-btn")),
    state=UserProfileSG.show_profile,
    getter=user_info_getter,
)

user_profile_dialog = Dialog(
    user_profile_window,
)
